const mongoose = require("mongoose");

const Schema = mongoose.Schema;

const userManage = new Schema({
  // 用户名
  userName: {
    type: String,
    required: true,
    unique: true,
  },

  // 头像
  avatar: {
    type: String,
  },

  // 手机号
  phone: {
    type: Number,
    required: true,
    unique: true,
  },

  // 邮箱
  email: {
    type: String,
    required: true,
    unique: true,
  },

  // 密码
  password: {
    type: String,
    required: true,
  },

  // 地址
  address: {
    type: [String],
  },

  // 详细地址
  detailAddress: {
    type: String,
  },

  // role: {
  //   type: String,
  //   required: true,
  // },

  registerTime: {
    type: Date,
    default: Date.now,
  },
});

module.exports = mongoose.model("userManage", userManage);
